<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
	<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<section class="content">
	<div class="box">
		<div class="box-header">
			<sf:form id="contextForm" cssClass="form-inline" method="post"
				modelAttribute="transactForm">
				<div class="form-group">
					<label>请求编号:</label>
					<sf:input path="requestId" cssClass="form-control" autocomplete="off"/>
				</div>
				<div class="form-group">
					<label>用户名称:</label>
					<sf:input path="username" cssClass="form-control" autocomplete="off"/>
				</div>
				<div class="form-group">
					<label>类型:</label>
					<sf:select path="type" cssClass="form-control">
						<sf:options items="${types }"/>
					</sf:select>
				</div>
				<div class="form-group">
					<label>选择日期:</label>
					<input type="text" class="form-control" id="date1">-<input id="to" type="text" class="form-control">
				</div>
				<input type="hidden" name="page">
				<button type="submit" class="btn btn-primary">查询</button>
			</sf:form>
		</div>
		<div class="box-body">
			<table class="table">
				<thead>
					<tr>
						<th>请求编号</th>
						<th>借款标号</th>
						<th>用户名称</th>
						<th>金额</th>
						<th>类型</th>
						<th>发送地址</th>
						<th>状态</th>
						<th>请求时间</th>
						<th>处理时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${transactRequests.iterator() }" var="obj">
						<tr>
							<td>${obj.id }</td>
							<td>${obj.borrowInfo.id }</td>
							<td>${obj.memberInfo.username }</td>
							<td>${obj.money }</td>
							<td>${obj.type }</td>
							<td>${obj.targetUrl }</td>
							<td>${obj.status }</td>
							<td>${obj.createTime }</td>
							<td>${obj.processingTime }</td>
							<td><a class="bootDialog" data-url="<s:url value="/manager/transact/details"><s:param name="requestId" value="${obj.id }"/></s:url>" href="javascript:void(0);">[详情]</a></td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<c:import url="/WEB-INF/commons/Page.jsp">
				<c:param name="totalElements" value="${transactRequests.totalElements}" />
				<c:param name="totalPages" value="${transactRequests.totalPages}" />
				<c:param name="isLast" value="${transactRequests.last}" />
				<c:param name="number" value="${transactRequests.number}" />
			</c:import>
		</div>
	</div>
</section>
<script type="text/javascript">
	$(document).ready(function(){
		var dateFormat = "";
		form = $("#date1").datepicker({
				defaultDate:"+1w",
				changeMonth:true,
				dateFormat:"yy-mm-dd"
			});
		to = $("#to").datepicker({
				defaultDate:"+1w",
				changeMonth:true,
				dateFormat:"yy-mm-dd"
			});

		$(".bootDialog").click(function(){
			var html = $("<div></div>").load($(this).attr("data-url"));
			BootstrapDialog.show({
				message:html
			});
			return false;
		});
		
	});
</script>